#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Time: 2019/4/12  14:00
# @Author: 余浪人
# @email: yulangren520@gmail.com


from apps.models import db, BaseModel


class Column_model(BaseModel):
    column_name = db.Column(db.String(1024), comment='分类名称')
    column_agree_nav = db.Column(db.Integer, default=1, comment='是否/导航|1是|2否')
    column_agree_index = db.Column(db.Integer, default=1, comment='是否/首页|1是|2否')
    column_page = db.Column(db.Integer, default=20, comment='分页容量')
    column_link = db.Column(db.String(1024), comment='跳转链接')
    column_keyword = db.Column(db.String(1024), comment='分类关键词')
    column_description = db.Column(db.String(1024), comment='分类描述')
    column_order = db.Column(db.Integer,default=0, comment='分类权重')
    column_color = db.Column(db.String(10),comment='分类栏目颜色')
    column_parent_id=db.Column(db.Integer,default=0,comment='父级ID|0_顶级')

    def __repr__(self):
        return f'分类:<{self.column_name}>'

    def keys(self):
        return 'column_name', 'column_agree_nav', 'column_agree_index', 'column_page', 'column_link', 'column_keyword', 'column_description','column_parent_id','column_order','column_color'
